<template><div><h2 id="email-认证" tabindex="-1"><a class="header-anchor" href="#email-认证"><span>Email 认证</span></a></h2>
<ul>
<li><a href="#introduction">简介</a>
<ul>
<li><a href="#model-preparation">准备模型</a></li>
<li><a href="#database-preparation">准备数据库</a></li>
</ul>
</li>
<li><a href="#verification-routing">路由</a>
<ul>
<li><a href="#the-email-verification-notice">Email 认证通知</a></li>
<li><a href="#the-email-verification-handler">Email 认证处理</a></li>
<li><a href="#resending-the-verification-email">重新发送 Email 认证</a></li>
<li><a href="#protecting-routes">保护路由</a></li>
</ul>
</li>
<li><a href="#customization">自定义</a></li>
<li><a href="#events">事件</a></li>
</ul>
<h2 id="简介" tabindex="-1"><a class="header-anchor" href="#简介"><span>简介</span></a></h2>
<p>很多 Web 应用会要求用户在使用之前进行 Email 地址验证。Laravel 不会强迫你在每个应用中重复实现它，而是提供了便捷的方法来发送和校验电子邮件的验证请求。</p>
<blockquote>
<p><strong>技巧</strong><br>
想快速上手吗？你可以在全新的应用中安装 <a href="https://learnku.com/docs/laravel/10.x/starter-kits" target="_blank" rel="noopener noreferrer">Laravel 应用入门套件</a> 。入门套件将帮助你搭建整个身份验证系统，包括电子邮件验证支持。</p>
</blockquote>
<h3 id="准备模型" tabindex="-1"><a class="header-anchor" href="#准备模型"><span>准备模型</span></a></h3>
<p>在开始之前，需要检查你的 <code v-pre>App\Models\User</code> 模型是否实现了 <code v-pre>Illuminate\Contracts\Auth\MustVerifyEmail</code> 契约：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token php language-php"><span class="token delimiter important">&lt;?php</span></span>
<span class="line"></span>
<span class="line"><span class="token keyword">namespace</span> <span class="token package">App<span class="token punctuation">\</span>Models</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Contracts<span class="token punctuation">\</span>Auth<span class="token punctuation">\</span>MustVerifyEmail</span><span class="token punctuation">;</span></span>
<span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Foundation<span class="token punctuation">\</span>Auth<span class="token punctuation">\</span>User</span> <span class="token keyword">as</span> Authenticatable<span class="token punctuation">;</span></span>
<span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Notifications<span class="token punctuation">\</span>Notifiable</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token keyword">class</span> <span class="token class-name-definition class-name">User</span> <span class="token keyword">extends</span> <span class="token class-name">Authenticatable</span> <span class="token keyword">implements</span> <span class="token class-name">MustVerifyEmail</span></span>
<span class="line"><span class="token punctuation">{</span></span>
<span class="line">    <span class="token keyword">use</span> <span class="token package">Notifiable</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line">    <span class="token comment">// ...</span></span>
<span class="line"><span class="token punctuation">}</span></span>
<span class="line"></span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>一旦这一接口被添加到模型中，新注册的用户将自动收到一封包含电子邮件验证链接的电子邮件。检查你的 <code v-pre>App\Providers\EventServiceProvider</code> 可以看到，Laravel 已经为 <code v-pre>Illuminate\Auth\Events\Registered</code> 事件注册了一个 <code v-pre>SendEmailVerificationNotification</code> <a href="https://learnku.com/docs/laravel/10.x/events" target="_blank" rel="noopener noreferrer">监听器</a> 。这个事件监听器会通过邮件发送验证链接给用户。<br>
如果在应用中你没有使用 <a href="https://learnku.com/docs/laravel/10.x/starter-kits" target="_blank" rel="noopener noreferrer">入门套件</a> 而是手动实现的注册，你需要确保在用户注册成功后手动分发 <code v-pre>Illuminate\Auth\Events\Registered</code> 事件：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Auth<span class="token punctuation">\</span>Events<span class="token punctuation">\</span>Registered</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token function">event</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Registered</span><span class="token punctuation">(</span><span class="token variable">$user</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="数据库准备" tabindex="-1"><a class="header-anchor" href="#数据库准备"><span>数据库准备</span></a></h3>
<p>接下来，你的 <code v-pre>users</code> 表必须有一个 <code v-pre>email_verified_at</code> 字段，用来存储用户邮箱验证的日期和时间。Laravel 框架自带的 <code v-pre>users</code> 表以及默认包含了该字段。因此，你只需运行数据库迁移即可：</p>
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre class="language-bash"><code><span class="line">php artisan migrate</span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h2 id="路由" tabindex="-1"><a class="header-anchor" href="#路由"><span>路由</span></a></h2>
<p>为了实现完整的电子邮件验证流程，你将需要定义三个路由。首先，需要定义一个路由向用户显示通知，告诉用户应该点击注册之后， Laravel 向他们发送的验证邮件中的链接。</p>
<p>其次，需要一个路由来处理用户点击邮件中验证链接时发来的请求。</p>
<p>第三，如果用户没有收到验证邮件，则需要一路由来重新发送验证邮件。</p>
<h3 id="邮箱验证通知" tabindex="-1"><a class="header-anchor" href="#邮箱验证通知"><span>邮箱验证通知</span></a></h3>
<p>如上所述，应该定义一条路由，该路由将返回一个视图，引导用户点击注册后 Laravel 发送给他们邮件中的验证链接。当用户尝试访问网站的其它页面而没有先完成邮箱验证时，将向用户显示此视图。请注意，只要您的 <code v-pre>App\Models\User</code> 模型实现了 <code v-pre>MustVerifyEmail</code> 接口，就会自动将该链接发邮件给用户：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token class-name static-context">Route</span><span class="token operator">::</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'/email/verify'</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span></span>
<span class="line">    <span class="token keyword">return</span> <span class="token function">view</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'auth.verify-email'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">middleware</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'auth'</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">name</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'verification.notice'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>显示邮箱验证的路由，应该命名为 <code v-pre>verification.notice</code>。配置这个命名路由很重要，因为如果用户邮箱验证未通过，Laravel 自带的<a href="#protecting-routes"><code v-pre>verified</code> 中间件</a> 将会自动重定向到该命名路由上。</p>
<blockquote>
<p><strong>注意</strong><br>
手动实现邮箱验证过程时，你需要自己定义验证通知视图。如果你希望包含所有必要的身份验证和验证视图，请查看 <a href="https://learnku.com/docs/laravel/10.x/starter-kits" target="_blank" rel="noopener noreferrer">Laravel 应用入门套件</a></p>
</blockquote>
<h3 id="email-认证处理" tabindex="-1"><a class="header-anchor" href="#email-认证处理"><span>Email 认证处理</span></a></h3>
<p>接下来，我们需要定义一个路由，该路由将处理当用户点击验证链接时发送的请求。该路由应命名为 <code v-pre>verification.verify</code> ，并添加了 <code v-pre>auth</code> 和 <code v-pre>signed</code> 中间件</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Foundation<span class="token punctuation">\</span>Auth<span class="token punctuation">\</span>EmailVerificationRequest</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token class-name static-context">Route</span><span class="token operator">::</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'/email/verify/{id}/{hash}'</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token class-name type-declaration">EmailVerificationRequest</span> <span class="token variable">$request</span><span class="token punctuation">)</span> <span class="token punctuation">{</span></span>
<span class="line">    <span class="token variable">$request</span><span class="token operator">-></span><span class="token function">fulfill</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line">    <span class="token keyword">return</span> <span class="token function">redirect</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'/home'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">middleware</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'auth'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'signed'</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">name</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'verification.verify'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>在继续之前，让我们仔细看一下这个路由。首先，您会注意到我们使用的是 <code v-pre>EmailVerificationRequest</code> 请求类型，而不是通常的 <code v-pre>Illuminate\Http\Request</code> 实例。 <code v-pre>EmailVerificationRequest</code> 是 Laravel 中包含的 <a href="https://learnku.com/docs/laravel/10.x/validation#form-request-validation" target="_blank" rel="noopener noreferrer">表单请求</a>。此请求将自动处理验证请求的 id 和 hash 参数。</p>
<p>接下来，我们可以直接在请求上调用 <code v-pre>fulfill</code> 方法。该方法将在经过身份验证的用户上调用 <code v-pre>markEmailAsVerified</code> 方法，并会触发 <code v-pre>Illuminate\Auth\Events\Verified</code> 事件。通过 <code v-pre>Illuminate\Foundation\Auth\User</code> 基类，<code v-pre>markEmailAsVerified</code> 方法可用于默认的 <code v-pre>App\Models\User</code> 模型。验证用户的电子邮件地址后，您可以将其重定向到任意位置。</p>
<h3 id="重新发送-email-认证邮件" tabindex="-1"><a class="header-anchor" href="#重新发送-email-认证邮件"><span>重新发送 Email 认证邮件</span></a></h3>
<p>有时候，用户可能输错了电子邮件地址或者不小心删除了验证邮件。为了解决这种问题，您可能会想定义一个路由实现用户重新发送验证邮件。您可以通过在 <a href="#the-email-verification-notice">验证通知视图</a> 中放置一个简单的表单来实现此功能。</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Http<span class="token punctuation">\</span>Request</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token class-name static-context">Route</span><span class="token operator">::</span><span class="token function">post</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'/email/verification-notification'</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token class-name type-declaration">Request</span> <span class="token variable">$request</span><span class="token punctuation">)</span> <span class="token punctuation">{</span></span>
<span class="line">    <span class="token variable">$request</span><span class="token operator">-></span><span class="token function">user</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">sendEmailVerificationNotification</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line">    <span class="token keyword">return</span> <span class="token function">back</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">with</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'message'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'Verification link sent!'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">middleware</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'auth'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'throttle:6,1'</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">name</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'verification.send'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="保护路由" tabindex="-1"><a class="header-anchor" href="#保护路由"><span>保护路由</span></a></h3>
<p><a href="https://learnku.com/docs/laravel/10.x/middleware" target="_blank" rel="noopener noreferrer">路由中间件</a>可用于仅允许经过验证的用户访问给定路由。Laravel 附带了一个 <code v-pre>verified</code> 中间件别名，它是 <code v-pre>Illuminate\Auth\Middleware\EnsureEmailIsVerified</code> 类的别名。由于该中间件已经在你的应用程序的 HTTP 内核中注册，所以你只需要将中间件附加到路由定义即可。通常，此中间件与 <code v-pre>auth</code> 中间件配对使用。</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token class-name static-context">Route</span><span class="token operator">::</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'/profile'</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span></span>
<span class="line">    <span class="token comment">// 仅经过验证的用户可以访问此路由。。。</span></span>
<span class="line"><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">middleware</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'auth'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'verified'</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>如果未经验证的用户尝试访问已被分配了此中间件的路由，他们将自动重定向到<code v-pre>verification.notice</code> <a href="https://learnku.com/docs/laravel/10.x/routing#named-routes" target="_blank" rel="noopener noreferrer">命名路由</a>。</p>
<h2 id="自定义" tabindex="-1"><a class="header-anchor" href="#自定义"><span>自定义</span></a></h2>
<h4 id="验证邮件自定义" tabindex="-1"><a class="header-anchor" href="#验证邮件自定义"><span>验证邮件自定义</span></a></h4>
<p>虽然默认的电子邮件验证通知应该能够满足大多数应用程序的要求，但 Laravel 允许你自定义如何构建电子邮件验证邮件消息。</p>
<p>要开始自定义邮件验证消息，你需要将一个闭包传递给 <code v-pre>Illuminate\Auth\Notifications\VerifyEmail</code> 通知提供的 <code v-pre>toMailUsing</code> 方法。该闭包将接收到通知的可通知模型实例以及用户必须访问以验证其电子邮件地址的已签名电子邮件验证 URL。该闭包应返回 <code v-pre>Illuminate\Notifications\Messages\MailMessage</code> 的实例。通常，你应该从应用程序的 <code v-pre>App\Providers\AuthServiceProvider</code> 类的 <code v-pre>boot</code> 方法中调用 <code v-pre>toMailUsing</code> 方法：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Auth<span class="token punctuation">\</span>Notifications<span class="token punctuation">\</span>VerifyEmail</span><span class="token punctuation">;</span></span>
<span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Notifications<span class="token punctuation">\</span>Messages<span class="token punctuation">\</span>MailMessage</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token doc-comment comment">/**</span>
<span class="line"> * 注册任何身份验证/授权服务。</span>
<span class="line"> */</span></span>
<span class="line"><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function-definition function">boot</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword return-type">void</span></span>
<span class="line"><span class="token punctuation">{</span></span>
<span class="line">    <span class="token comment">// ...</span></span>
<span class="line"></span>
<span class="line">    <span class="token class-name static-context">VerifyEmail</span><span class="token operator">::</span><span class="token function">toMailUsing</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token keyword type-hint">object</span> <span class="token variable">$notifiable</span><span class="token punctuation">,</span> <span class="token keyword type-hint">string</span> <span class="token variable">$url</span><span class="token punctuation">)</span> <span class="token punctuation">{</span></span>
<span class="line">        <span class="token keyword">return</span> <span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">MailMessage</span><span class="token punctuation">)</span></span>
<span class="line">            <span class="token operator">-></span><span class="token function">subject</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'Verify Email Address'</span><span class="token punctuation">)</span></span>
<span class="line">            <span class="token operator">-></span><span class="token function">line</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'Click the button below to verify your email address.'</span><span class="token punctuation">)</span></span>
<span class="line">            <span class="token operator">-></span><span class="token function">action</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'Verify Email Address'</span><span class="token punctuation">,</span> <span class="token variable">$url</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line">    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"><span class="token punctuation">}</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><blockquote>
<p>技巧：要了解更多有关邮件通知的信息，请参阅<a href="https://learnku.com/docs/laravel/10.x/notifications#mail-notifications" target="_blank" rel="noopener noreferrer"><br>
邮件通知文档</a>。</p>
</blockquote>
<h2 id="事件" tabindex="-1"><a class="header-anchor" href="#事件"><span>事件</span></a></h2>
<p>如果你是使用 <a href="https://learnku.com/docs/laravel/10.x/starter-kits" target="_blank" rel="noopener noreferrer">Laravel 应用入门套件</a> 的话，Laravel 在电子邮件验证通过后会派发 <a href="https://learnku.com/docs/laravel/10.x/events" target="_blank" rel="noopener noreferrer">事件</a> 。如果你想接收到这个事件并进行手动处理的话，你应该在 <code v-pre>EventServiceProvider</code> 中注册监听器：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">use</span> <span class="token package">App<span class="token punctuation">\</span>Listeners<span class="token punctuation">\</span>LogVerifiedUser</span><span class="token punctuation">;</span></span>
<span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Auth<span class="token punctuation">\</span>Events<span class="token punctuation">\</span>Verified</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token doc-comment comment">/**</span>
<span class="line"> * 应用的事件监听器</span>
<span class="line"> *</span>
<span class="line"> * <span class="token keyword">@var</span> <span class="token class-name"><span class="token keyword">array</span></span></span>
<span class="line"> */</span></span>
<span class="line"><span class="token keyword">protected</span> <span class="token variable">$listen</span> <span class="token operator">=</span> <span class="token punctuation">[</span></span>
<span class="line">    <span class="token class-name static-context">Verified</span><span class="token operator">::</span><span class="token keyword">class</span> <span class="token operator">=></span> <span class="token punctuation">[</span></span>
<span class="line">        <span class="token class-name static-context">LogVerifiedUser</span><span class="token operator">::</span><span class="token keyword">class</span><span class="token punctuation">,</span></span>
<span class="line">    <span class="token punctuation">]</span><span class="token punctuation">,</span></span>
<span class="line"><span class="token punctuation">]</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><blockquote>
<p>本译文仅用于学习和交流目的，转载请务必注明文章译者、出处、和本文链接<br>
我们的翻译工作遵照 <a href="https://learnku.com/docs/guide/cc4.0/6589" target="_blank" rel="noopener noreferrer">CC 协议</a>，如果我们的工作有侵犯到您的权益，请及时联系我们。</p>
</blockquote>
<hr>
<blockquote>
<p>原文地址：<a href="https://learnku.com/docs/laravel/10.x/verification/14878" target="_blank" rel="noopener noreferrer">https://learnku.com/docs/laravel/10.x/ve...</a></p>
<p>译文地址：<a href="https://learnku.com/docs/laravel/10.x/verification/14878" target="_blank" rel="noopener noreferrer">https://learnku.com/docs/laravel/10.x/ve...</a></p>
</blockquote>
</div></template>


